{
  lib,
  stdenvNoCC,
  fetchFromGitHub,
  librime,
  rime-data,
}:
stdenvNoCC.mkDerivation {
  pname = "rime-flypy";
  version = "20250602";
  src = fetchFromGitHub {
    owner = "cubercsl";
    repo = "rime-flypy";
    rev = "604839ef272b2bf0262aa70dc1356c39b21a9d12";
    hash = "sha256-JY1olnWHIHQnU5LGL/1gMhl1JDSC34LQkkhogUZmffA=";
  };
  nativeBuildInputs = [ librime ];
  makeFlags = [ "PREFIX=$(out)" ];
  buildPhase = ''
    runHook preBuild
    rime_deployer --compile flypy.schema.yaml . ${rime-data}/share/rime-data
    rime_deployer --compile flypydz.schema.yaml . ${rime-data}/share/rime-data
    runHook postBuild
  '';
}
